﻿function GraphData(graphCurrent, graphLast, graphLow, graphHigh, yAxis) {                   //function to hold graph data paramaters
    this.graphCurrent = graphCurrent;
    this.graphLast = graphLast;
    this.graphLow = graphLow;
    this.graphHigh = graphHigh;
    this.yAxis = yAxis;
}


function Graph(click) {                                                                      //function to display graph

    var plot1 = [[1, DetailsGraph.graphLast], [2, DetailsGraph.graphCurrent]];
    var plot2 = [[1, DetailsGraph.graphLow], [2, DetailsGraph.graphLow]];
    var plot3 = [[1, DetailsGraph.graphHigh], [2, DetailsGraph.graphHigh]];

    if (click == 0) {
        $('#chart1').html('');
        var yaxis = DetailsGraph.yAxis;
        $.jqplot('chart1', [plot1, plot2, plot3], {
            series: [{ showMarker: false}],
            axes: {
                xaxis: {
                    label: 'Last to Current Trend'
                },
                yaxis: {
                    label: 'Value'
                }
            }
        });
    }

    if (click == 1) {
        $('#chart1').html('');
    }
}